//
//  UIPhotoView.h
//  storeapp
//
//  Created by huangyi on 13-3-15.
//  Copyright (c) 2013年 ios. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ENUM(int, UIPhotoViewMode){
    UIPhotoViewModeViewPhoto,
    UIPhotoViewModeDrawCanvas,
    UIPhotoViewModeEditOverlay,
    UIPhotoViewModeShowOverlay,
    UIPhotoViewModeHideOverlay,
};

@interface UIPhotoView : UIView

@property(nonatomic)float translateX;
@property(nonatomic)float translateY;
@property(nonatomic)float rotate;
@property(nonatomic)float scale;

@property(nonatomic)BOOL allowMoveAndScale;
@property(nonatomic)BOOL allowRotate;

@property(nonatomic)BOOL isOverlayHidden;

-(void)addTarget:(id)target action:(SEL)action;

-(UIImage*)image;
-(void)setImage:(UIImage*)image;
-(void)setImageFromURL:(NSString*)urlstr;
-(void)setOverlayWithViews:(NSArray*)array;
-(void)addOverlayWithView:(UIView*)view;

-(void)viewPhoto:(BOOL)enable;

-(void)drawWithSize:(CGFloat)penSize andColor:(UIColor*)penColor;
-(void)clearCanvas;

-(void)layoutOverlay:(BOOL)editing;
-(void)showOverlay:(BOOL)hidden;

-(UIImage*)renderToImage;

-(NSArray*)dumpOverlayInfo;

@end
